package com.njym.java.security.admin.rest;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.njym.java.security.admin.biz.CourseSectionBiz;
import com.njym.java.security.admin.entity.CourseSection;
import com.njym.java.security.common.msg.TableResultResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("courseSection")
public class CourseSectionController extends BaseController<CourseSectionBiz, CourseSection> {

    @RequestMapping(value = "/getListByParams",method = RequestMethod.GET)
    @ResponseBody
    public Object getListByParams(Integer page, Integer limit, String title, Integer couId) {
        Page<Object> result = PageHelper.startPage(page,limit);
        baseBiz.getListByParams(title, couId);
        return new TableResultResponse<>(result.getTotal(),result.getResult());
    }

}